using PropertyExpression.ReactiveRelation.Values;

namespace PropertyExpression.ReactiveRelation.Test
{
    internal static class QuoteJobCalc
    {
        internal static IValue<decimal> LaborSubtotal(this IPropertyHolder<QuoteJob> job)
        {
            return job._(_ => _.LaborTime).Mult(job._(_ => _.LaborRate));
        }

        internal static IValue<decimal> PartSubtotal(this IPropertyHolder<QuoteJob> job)
        {
            return job._(_ => _.QuoteParts).Sum(
                part => part._(_ => _.Quantity).Mult(part._(_ => _.Price))
                );
        }
    }
}